package com.example.apartment.common;

/**
 * 异常枚举
 *
 * @author wuzexin
 * @date 2021/10/27 20:24
 */
public enum RespExceptionEnum {
    NEED_USER_NAME(10001, "用户名不能为空"),
    NEED_PASSWORD(10002, "密码不能为空"),
    USERNAME_EXISTS(10003, "用户名已存在"),
    CELLPHONE_EXISTS(10004, "手机号码已注册"),
    REGISTER_FAILED(10005, "注册失败"),
    PASSWORD_WRONG(10006, "用户名或密码错误"),
    NEED_CELLPHONE(10007, "手机号码不能为空"),
    NEED_PERMISSIONS(10008, "用户权限不够"),
    BUILDING_NAME_EXISTS(10009, "宿舍楼名字已存在"),
    INSERT_FAILED(10010, "新增失败"),
    UPDATE_FAILED(10011, "更新失败"),
    DELETE_FAILED(10012, "删除失败"),
    BUILDING_NOT_EMPTY(10013, "宿舍楼不为空"),
    NEED_LOGIN(10014, "未登录"),
    ROOM_NUM_EXISTS(10021, "宿舍号已存在"),
    ROOM_NOT_EMPTY(10022, "宿舍不为空"),
    BUILDING_NOT_EXISTS(10023, "宿舍楼不存在"),
    ROOM_NOT_EXISTS(10030, "宿舍不存在"),
    BED_NUM_EXISTS(10031, "床位号已存在"),
    BED_NOT_EMPTY(10032, "床位不为空"),
    BED_NOT_EXISTS(10033, "床位不存在"),
    BED_HAS_PERSON(10041, "床位已有人住"),
    SID_IS_EXISTS(10050, "学号已存在"),
    ID_NOT_EXISTS(10051, "ID不存在"),
    BUILDING_HAS_ADMIN(10052, "宿舍楼已存在管理员"),
    SYSTEM_ERROR(20001, "系统异常");


    /*
        异常码
     */
    private final Integer code;
    /*
        异常信息
     */
    private final String msg;

    RespExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
